{% extends "front/base.html" %}

{% block content %}
<!-- 页面标题 -->
<section class="page-header bg-light py-5">
    <div class="container">
        <h1 class="text-center mb-0">{{ '聯繫我們' | t }}</h1>
        <p class="lead text-center mt-3 text-muted">{{ '期待與您建立合作關係' | t }}</p>
    </div>
</section>

<!-- 联系信息 -->
<section class="contact-section section-padding">
    <div class="container">
        <div class="row">
            <!-- 左侧联系信息 -->
            <div class="col-lg-6 mb-4 mb-lg-0">
                <div class="contact-info">
                    <h3 class="mb-4">{{ '聯繫方式' | t }}</h3>
                    <div class="info-item mb-4">
                        <i class="fas fa-map-marker-alt text-primary me-2"></i>
                        <div>
                            <h5>{{ '公司地址' | t }}</h5>
                            <p>FLAT/RM 1411 14/F EASTERN HARBOUR CENTRE<br>
                               28 HOI CHAK STREET QUARRY BAY，HK</p>
                        </div>
                    </div>
                    <div class="info-item mb-4">
                        <i class="fas fa-phone text-primary me-2"></i>
                        <div>
                            <h5>{{ '聯繫電話' | t }}</h5>
                            <p>+852-97046393</p>
                        </div>
                    </div>
                    <div class="info-item mb-4">
                        <i class="fas fa-envelope text-primary me-2"></i>
                        <div>
                            <h5>{{ '電子郵箱' | t }}</h5>
                            <p>imiracle2024@hotmail.com</p>
                        </div>
                    </div>
                    <div class="info-item">
                        <i class="fas fa-clock text-primary me-2"></i>
                        <div>
                            <h5>{{ '營業時間' | t }}</h5>
                            <p>{{ '週一至週五：上午9:00 - 下午6:00' | t }}<br>
                               {{ '週六、週日：休息' | t }}</p>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 右侧地图 -->
            <div class="col-lg-6">
                <div class="contact-map">
                    <h3 class="mb-4">{{ '公司位置' | t }}</h3>
                    <div class="map-container">
                        <img src="{{ url_for('static', filename='images/contact/office-map.jpg') }}" 
                             alt="公司位置地图" 
                             class="img-fluid rounded shadow">
                    </div>
                    <div class="mt-4">
                        <h5>{{ '交通方式' | t }}</h5>
                        <p>{{ '鰂魚涌地鐵站A出口步行約5分鐘' | t }}</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- 联系表单 -->
        <div class="row mt-5">
            <div class="col-12">
                <div class="contact-form bg-light p-4 rounded">
                    <h3 class="text-center mb-4">{{ '在線諮詢' | t }}</h3>
                    
                    <!-- Flash消息显示 -->
                    {% with messages = get_flashed_messages(with_categories=true) %}
                        {% if messages %}
                            {% for category, message in messages %}
                                <div class="alert alert-{{ category }}">
                                    {{ message }}
                                </div>
                            {% endfor %}
                        {% endif %}
                    {% endwith %}
                    
                    <form method="POST" action="{{ url_for('front.contact') }}">
                        <div class="row">
                            <div class="col-md-6 mb-3">
                                <label for="name" class="form-label">{{ '姓名' | t }}</label>
                                <input type="text" class="form-control" id="name" name="name" required
                                       minlength="2" maxlength="100">
                            </div>
                            <div class="col-md-6 mb-3">
                                <label for="phone" class="form-label">{{ '電話' | t }}</label>
                                <input type="tel" class="form-control" id="phone" name="phone" required
                                       pattern="[0-9+\-\s]{8,20}">
                            </div>
                            <div class="col-12 mb-3">
                                <label for="email" class="form-label">{{ '電子郵箱' | t }}</label>
                                <input type="email" class="form-control" id="email" name="email" required>
                            </div>
                            <div class="col-12 mb-3">
                                <label for="message" class="form-label">{{ '諮詢內容' | t }}</label>
                                <textarea class="form-control" id="message" name="message" rows="5" required
                                          minlength="10" maxlength="1000"></textarea>
                            </div>
                            <div class="col-12 text-center">
                                <button type="submit" class="btn btn-primary btn-lg">
                                    {{ '提交' | t }}
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>
{% endblock %} 